View Javadoc

1   /*
2    * Copyright (c) 2004-2005, University Health Network.  All rights reserved. Distributed under the BSD 
3    * license (see http://opensource.org/licenses/bsd-license.php).
4    *  
5    * Created on 29-Nov-2004
6    */
7   package ca.uhn.cache;
8   
9   /***
10   * A multi-dimensional space of <code>IQueryParam</code>s.  A data item 
11   * has a location in this space (see <code>IDataInspector</code>).  Data 
12   * items are divided into <code>IChunk</code>s that represent regions of the 
13   * space.  
14   *   
15   * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
16   * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:52:08 $ by $Author: bryan_tripp $
17   */
18  public interface IParamSpace {
19  
20      /***
21       * @return a list of dimensions according to which data are chunked. 
22       */  
23      public IDimension[] getDimensions();
24          
25      /***
26       * TODO: this assumes that chunk sizes along a given dimension are independent of other 
27       * dimensions, but this may not be feasible.  For example, possibly sparse data (e.g. ECG
28       * should be divided into longer time spans than oft-collected data (e.g. CBC), in order 
29       * to have an efficient number of data items per chunk. RESOLUTION: allow multiple caches 
30       * in SelfCachingDataSource
31       *   
32       * @param theParam a <code>IQueryParam</code>
33       * 
34       * @return a list of <code>IQueryParam</code>s that together encompasses the given 
35       *      <code>IQueryParam</code>, each of which corresponds to the size of a 
36       *      <code>IChunk</code>. 
37       */
38      public IQueryParam[] chunk(IQueryParam theParam);
39      
40      /***
41       * Given a list of queries, finds a small set of queries that includes all of them, 
42       * without including too many queries that aren't in the list.  There may    
43       * be a trade-off between number of queries returned and extra queries included.  
44       * For example, one query could be returned for each original query, in which case no extra
45       * queries would be included.  On the other hand a single query 
46       * could be returnd which covers the whole IParamSpace.  Good solutions lie 
47       * somewhere between these extremes.     
48       * 
49       * @param theQueries a list of <code>IQuery</code>ies to be covered by the returned 
50       *      <code>IQuery</code>s
51       *       
52       * @param theMaxGroups maximum number of <code>IQuery</code>s returned (lower numbers
53       *      will generally force more extra chunks to be spanned)
54       *      
55       * @return a list of <code>IQuery</code>s that include all the specified chunks 
56       */
57      public IQuery[] group(IQuery[] theQueries, int theMaxGroups);
58      
59  }